home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / AECUR100.ARJ / WDELCH.C < prev    next >
C/C++ Source or Header  |  1990-03-08  |  772b  |  35 lines

  1. /*------------------------------------------------------------
  2.  * 
  3.  *  wdelch.c
  4.  * 
  5.  *  copyright (c) 1987,88,89,90 J. Alan Eldridge
  6.  *
  7.  *  deletes a char at the cursor position in a window
  8.  *  rightmost char on line is blanked
  9.  * 
  10.  *----------------------------------------------------------*/
  11.  
  12. #include "curses.h"
  13.  
  14. int
  15. wdelch(win)
  16. WINDOW *win;
  17. {
  18.     VIDCHR *ptr;
  19.     int cury, curx, endcol;
  20.  
  21.     getyx(win, cury, curx);
  22.     markwin(win);
  23.     endcol = win->maxx;
  24.     ptr = &(win->buf[cury][curx]);
  25.     memcpy(ptr, ptr + 1, (endcol - curx) * sizeof(VIDCHR));
  26.     wmove(win, cury, endcol);
  27.     win->buf[cury][endcol].chr = ' ';
  28.     win->buf[cury][endcol].att = win->attrib;
  29.     markwin(win);
  30.     wmove(win, cury, curx);
  31.  
  32.     return OK;
  33. }
  34.  
  35.